#include <iostream>

using namespace std;

/*
	1、Dereferencing指针废弃运算符->，必须通过成员方法重载
	2、必须返回一个指针
*/
struct Student { 
	int age;
	int ID; 
};

class X {
public:
	X() { S = new Student; S->age = 0; S->ID = 0; }
	
	Student* operator->() { return S; }
	
	~X() { delete S; }
	
public:
	Student *S;
};

int main()
{
	X x;
	x->age = 20; // (x.operator->())->age = 20;
	x->ID = 001; // (x.operator->())->ID = 001;
	
	return 0;
}